-- Neovim Configuration Module: Universal Keymap --
local default_opts = {
	silent = true,
}

local keymap = {
	--- Movement ---
	{
		'', 'gh',
		'<Home>',
		{ desc = 'To beginning of line (keep text column)' },
	},
	{
		'', 'gj',
		'<PageDown>',
		{ desc = 'Scroll forward pages' },
	},
	{
		'', 'gk',
		'<PageUp>',
		{ desc = 'Scroll backward pages' },
	},
	{
		'', 'gl',
		'<End>',
		{ desc = 'To end of line' },
	},

	{
		'', '<C-p>',
		'<C-u>',
		{ desc = 'Scroll upwards' },
	},
	{
		'', '<C-n>',
		'<C-d>',
		{ desc = 'Scroll downwards' },
	},

	{
		'', '<Up>',
		'g<Up>',
		{ desc = 'Display line upwards' },
	},
	{
		'i', '<Up>',
		'<C-o>g<Up>',
		{ desc = 'Display line upwards' },
	},
	{
		'', '<Down>',
		'g<Down>',
		{ desc = 'Display line downwards' },
	},
	{
		'i', '<Down>',
		'<C-o>g<Down>',
		{ desc = 'Display line downwards' },
	},

	--- Jumping ---
	{
		'', '<Esc>',
		'<C-[>',
		{ desc = 'Cancel' },
	},
	{
		'', '<CR>',
		'<C-]>',
		{ desc = 'To definition' },
	},
}

BindKeys(keymap, default_opts)
